package com.it.demo03;


import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable mc = new MyCallable();
        FutureTask<String> fu = new FutureTask<>(mc);
        Thread t1 = new Thread(fu);
        t1.start();
        String s = fu.get();
        System.out.println(s);
    }
}
